package org.tools.wstt.utils.logger;

import java.util.HashMap;

public class WsttLoggerFactory {

	private static HashMap sLoggersCache = new HashMap();

	/**
	 * 
	 * @param pClass
	 * @return
	 */
	public static IWsttLogger getLogger(Class pClass) {
		WsttLoggerImpl logger = null;

		logger = (WsttLoggerImpl) sLoggersCache.get(pClass);
		if (logger == null) {
			logger = new WsttLoggerImpl(pClass);
			sLoggersCache.put(pClass, logger);
		}

		return logger;
	}

	/**
	 * 
	 * @param pClassName
	 * @return
	 */
	public static IWsttLogger getLogger(String pClassName) {
		WsttLoggerImpl vLogger = null;

		vLogger = (WsttLoggerImpl) sLoggersCache.get(pClassName);
		if (vLogger == null) {
			vLogger = new WsttLoggerImpl(pClassName);
			sLoggersCache.put(pClassName, vLogger);
		}

		return vLogger;
	}

}
